package com.jason.platform.supervision.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.hzlj.supervision.changsha.R;
import com.jason.platform.supervision.utils.CommonUtils;
import com.jason.platform.supervision.widght.TitleBar;

/**
 * @ClassName: AboutActivity
 * @Description: 关于我们
 * @Author: Jason.Zhang zhangyujn1989ok@gmail.com
 * @Date: 2015-7-25 09:51:53
 */
public class AboutActivity extends BaseActivity {

    private static final String TAG = AboutActivity.class.getSimpleName();

    private TitleBar mTitleBar;
    private TextView mVersionNameTextView, mPhoneTextView;

    @Override
    void handleMessage(BaseActivity activity, Message msg) {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_about);
        super.onCreate(savedInstanceState);
        mTitleBar = (TitleBar) findViewById(R.id.title_bar);
        mTitleBar.bindActivity(this);
        mVersionNameTextView = (TextView) findViewById(R.id.about_version_name);
        mVersionNameTextView.setText(CommonUtils.getVersionName(this));
        mPhoneTextView = (TextView) findViewById(R.id.about_phone);
        mPhoneTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String phone = mPhoneTextView.getText().toString();
                if (!TextUtils.isEmpty(phone)) {
                    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phone));
                    startActivity(intent);
                } else {
                    Toast.makeText(AboutActivity.this, "没有手机号码无法拨打", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}
